Socket
Socket
Sign inDemoInstall

@wojtekmaj/predict-input-value

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wojtekmaj/predict-input-value

Predicts the input value during KeyDown or KeyPress events, before the input is actually changed


Version published
Weekly downloads
378
decreased by-8.47%
Maintainers
1
Weekly downloads
 
Created
Source

npm downloads CI

Predict-Input-Value

Predicts the input value during KeyDown or KeyPress events, before the input is actually changed.

tl;dr

  • Install by executing npm install @wojtekmaj/predict-input-value or yarn add @wojtekmaj/predict-input-value.
  • Import by adding import predictInputValue from '@wojtekmaj/predict-input-value'.
  • Use it by writing const nextValue = predictInputValue(event).

Example

Conditions:

  • Input: value "hello"
  • Selected text: "ello"
  • Key pressed: i
function onKeyPress(event: React.KeyboardEvent<HTMLInputElement>): void {
  const nextValue = predictInputValue(event); // "hi"
}

License

The MIT License.

Author

Wojciech Maj Wojciech Maj

Keywords

FAQs

Package last updated on 18 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc